package com.ruitu.health_1.dao.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;

import java.io.Serializable;

public class OrderItemList implements Parcelable {

    /**
     * id : 88
     * orderId : 64
     * orderSn : 202001010101000016
     * couponHistoryId : null
     * productId : 26
     * productPic : http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/5ac1bf58Ndefaac16.jpg
     * productName : 华为 HUAWEI P20
     * couponAmount : 0
     * integrationAmount : 0
     * realAmount : 3788
     * giftIntegration : 0
     * giftGrowth : 0
     * type : 0
     */

    private String id;
    private String orderId;
    private String orderSn;
    private String storeName;
    private Object couponHistoryId;
    private String productId;
    private String productPic;
    private String productName;
    private String couponAmount;
    private String integrationAmount;
    private String realAmount;
    private String giftIntegration;
    private String giftGrowth;
    private int type;
    private String goodsInfo;
    private GoodsInfo good;
    private boolean isCheck;
    private String status;

    protected OrderItemList(Parcel in) {
        id = in.readString();
        orderId = in.readString();
        orderSn = in.readString();
        storeName = in.readString();
        productId = in.readString();
        productPic = in.readString();
        productName = in.readString();
        couponAmount = in.readString();
        integrationAmount = in.readString();
        realAmount = in.readString();
        giftIntegration = in.readString();
        giftGrowth = in.readString();
        type = in.readInt();
        goodsInfo = in.readString();
        good = in.readParcelable(GoodsInfo.class.getClassLoader());
        isCheck = in.readByte() != 0;
        status = in.readString();
    }

    public static final Creator<OrderItemList> CREATOR = new Creator<OrderItemList>() {
        @Override
        public OrderItemList createFromParcel(Parcel in) {
            return new OrderItemList(in);
        }

        @Override
        public OrderItemList[] newArray(int size) {
            return new OrderItemList[size];
        }
    };

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public GoodsInfo getGood() {
        good = new Gson().fromJson(goodsInfo, GoodsInfo.class);
        return good;
    }

    public void setGood(GoodsInfo good) {
        this.good = good;
    }

    public String getGoodsInfo() {

        return goodsInfo;
    }

    public void setGoodsInfo(String goodsInfo) {
        this.goodsInfo = goodsInfo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public Object getCouponHistoryId() {
        return couponHistoryId;
    }

    public void setCouponHistoryId(Object couponHistoryId) {
        this.couponHistoryId = couponHistoryId;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductPic() {
        return productPic;
    }

    public void setProductPic(String productPic) {
        this.productPic = productPic;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(String couponAmount) {
        this.couponAmount = couponAmount;
    }

    public String getIntegrationAmount() {
        return integrationAmount;
    }

    public void setIntegrationAmount(String integrationAmount) {
        this.integrationAmount = integrationAmount;
    }

    public String getRealAmount() {
        return realAmount;
    }

    public void setRealAmount(String realAmount) {
        this.realAmount = realAmount;
    }

    public String getGiftIntegration() {
        return giftIntegration;
    }

    public void setGiftIntegration(String giftIntegration) {
        this.giftIntegration = giftIntegration;
    }

    public String getGiftGrowth() {
        return giftGrowth;
    }

    public void setGiftGrowth(String giftGrowth) {
        this.giftGrowth = giftGrowth;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }


    @Override
    public String toString() {
        return "OrderItemList{" +
                "id='" + id + '\'' +
                ", orderId='" + orderId + '\'' +
                ", orderSn='" + orderSn + '\'' +
                ", storeName='" + storeName + '\'' +
                ", couponHistoryId=" + couponHistoryId +
                ", productId='" + productId + '\'' +
                ", productPic='" + productPic + '\'' +
                ", productName='" + productName + '\'' +
                ", couponAmount='" + couponAmount + '\'' +
                ", integrationAmount='" + integrationAmount + '\'' +
                ", realAmount='" + realAmount + '\'' +
                ", giftIntegration='" + giftIntegration + '\'' +
                ", giftGrowth='" + giftGrowth + '\'' +
                ", type=" + type +
                ", goodsInfo='" + goodsInfo + '\'' +
                ", good=" + good +
                ", isCheck=" + isCheck +
                ", status='" + status + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(orderId);
        dest.writeString(orderSn);
        dest.writeString(storeName);
        dest.writeString(productId);
        dest.writeString(productPic);
        dest.writeString(productName);
        dest.writeString(couponAmount);
        dest.writeString(integrationAmount);
        dest.writeString(realAmount);
        dest.writeString(giftIntegration);
        dest.writeString(giftGrowth);
        dest.writeInt(type);
        dest.writeString(goodsInfo);
        dest.writeParcelable(good, flags);
        dest.writeByte((byte) (isCheck ? 1 : 0));
        dest.writeString(status);
    }
}
